local skynet = require "skynet"
local filelog = require "filelog"
local helperbase = require "helperbase"
local filename = "authdbsvrhelper.lua"
local base = require "base"
local AuthdbsvrHelper = helperbase:new({}) 

function AuthdbsvrHelper:get_redissvrid_byusername(user_name)
	local server = self.server
	if user_name == nil then
		return nil
	end	

	local index = base.strtohash(user_name) % (#(server.redisdb_service)) + 1
	return server.redisdb_service[index]
end

function AuthdbsvrHelper:get_mysqlsvrid_byusername(user_name)
	local server = self.server
	if user_name == nil then
		return nil
	end	

	local index = base.strtohash(user_name) % (#(server.mysqldb_service)) + 1
	return server.mysqldb_service[index]
end


return	AuthdbsvrHelper 